package com.sunlands.qdcy.deskmate.dao.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "order_record")
@JsonSerialize
@DynamicUpdate
@DynamicInsert
public class OrderRecordDO implements Serializable {
    private static final long serialVersionUID = -7058313764355910820L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 支付方式
     * @see com.sunlands.qdcy.deskmate.enums.PayType
     */
    private String payType;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 商户唯一订单号
     */
    private String outTradeNo;
    /**
     * 商品类型编号(vip会员套餐编号)
     */
    private Long goodsNumber;
    /**
     * 商户交易号
     */
    private String tradeNo;
    /**
     * 订单总金额，单位元
     */
    private BigDecimal totalAmount;
    /**
     * 商品标题
     */
    private String subject;
    /**
     * 商品描述
     */
    private String body;
    /**
     * 服务商appId
     */
    private String appId;
    /**
     * 交易状态
     * @see com.sunlands.qdcy.deskmate.enums.OrderStatus
     */
    private String orderStatus;
    /**
     * 交易付款时间
     */
    private Date paymentTime;
    /**
     * 交易结束时间
     */
    private Date payEndTime;
    /**
     * 退货时间
     */
    private Date returnTime;
    /**
     * 是都发货
     */
    private Integer send;

    /**
     * 是否真实支付：1-是，0-否
     */
    private Integer payEnv;

    private String productId;

    private Date purchaseDate;

    @CreationTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @UpdateTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;


}